import org.jasypt.intf.service.JasyptStatelessService;

public class JasyptDemo {

	public static void main(String[] args) {
		String password = "mVHr2NjwZJ8MLgTZrw3bWm1nCHDbma3x";
		String data = "qGDc33Ryp338p0G6";

		data = encrypt(password, data);
		System.out.println(data);

		data = decrypt(password, data);
		System.out.println(data);

	}

	public static String decrypt(String password, String data) {
		JasyptStatelessService jasyptStatelessService = new JasyptStatelessService();
		return jasyptStatelessService.decrypt(data, password, null,null,null,null,null,null,null,
				null,null,null,null,null,null,
				null,null,null,null,null,null,null);
	}

	public static String encrypt(String password, String data) {
		JasyptStatelessService jasyptStatelessService = new JasyptStatelessService();
		return jasyptStatelessService.encrypt(data, password, null,null,"PBEWithMD5AndDES",null,null,null,null,
				null,null,null,null,null,null,
				null,null,null,null,null,null,null);
	}

}
